package com.composite.self;

import java.util.ArrayList;
import java.util.List;

public class University extends BaseOrganization{

    public List<BaseOrganization> baseOrganizations=new ArrayList<>();

    @Override
    protected void addBaseOrganization(BaseOrganization baseOrganization) {
        this.baseOrganizations.add(baseOrganization);
    }

    @Override
    protected void removeBaseOrganization(BaseOrganization baseOrganization) {
        this.baseOrganizations.remove(baseOrganization);
    }

    public University(String name, String state) {
        super(name, state);
    }

    @Override
    public void print() {
        System.out.println("--------"+getName()+"");
        for(BaseOrganization baseOrganization:baseOrganizations){
            baseOrganization.print();
        }
    }
}
